package com.gold.consumerdemo.service;

import com.gold.consumerdemo.service.impl.HelloServiceHystrix;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 定义一个feign接口，通过@ FeignClient（“服务名”），来指定调用哪个服务
 */
@FeignClient(value="gold-provider-demo",fallback = HelloServiceHystrix.class)
public interface HelloService {

    @RequestMapping(value="/gold-provider-demo/hello",method = RequestMethod.GET)
    String sayHello(@RequestParam(value="name") String name);
}
